import request from '@/utils/request'
import { ILoginReturn, IRuleForm } from '../types'
import qs from 'qs'

export const userLogin = (data:IRuleForm) => {
  return request<ILoginReturn>({
    method: 'POST',
    url: '/front/user/login',
    data: qs.stringify(data)
  })
}

export const getUserInfo = () => {
  return request<ILoginReturn>({
    method: 'GET',
    url: '/front/user/getInfo'
  })
}

export const logout = () => {
  return request<ILoginReturn>({
    method: 'POST',
    url: '/front/user/logout'
  })
}
